#!/usr/bin/env python 
# encoding: utf-8 
# @Author: Jacqueline
# @file: demo3腾讯客服显示等待.py
# @time: 2021/2/22 15:42
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

def work1():
    '''腾讯客服页面操作'''
    driver = webdriver.Chrome()
    driver.get('https://kf.qq.com/product/weixin.html')
    WebDriverWait(driver,10,0.5).until(
        EC.element_to_be_clickable((By.XPATH,"//a[text()='手机版微信']"))).click()
    time.sleep(3)
    driver.quit()
    # EC.presence_of_element_located   等待元素存在，存在不一定能点
    # EC.visibility_of_element_located   等待元素可点击
